package com.arpa.wms.service;

import com.arpa.wms.domain.dto.AllocationDTO;
import com.arpa.wms.domain.entity.Allocation;
import com.arpa.wms.domain.entity.Receive;
import com.arpa.wms.domain.vo.AllocationVO;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 * WMS调拨单 服务类
 * </p>
 *
 * @author LEO
 * @since 2020-11-17
 */
public interface IAllocationService extends IService<Allocation> {

    /**
     * 保存
     * @param entity
     * @return
     */
    @Override
    boolean save(Allocation entity);

    /**
     * 根据编码获取调拨单
     * @param code
     * @return
     */
    AllocationVO getOneByCode(String code);
    /**
     * 根据code更新实体
     * @param entity
     * @return
     */
    int updateByCode(Allocation entity);

    /**
     * 查询列表
     * @param allocationDTO
     * @return
     */
    List<AllocationVO> queryList(AllocationDTO allocationDTO);

    /**
     * 查询合计,包含总数
     * @param allocationDTO
     * @return
     */
    AllocationVO queryListSum(AllocationDTO allocationDTO);



    /**
     * 更新 调拨单状态
     * @param code
     * @param status
     * @return
     */
    int updateStatusByCode(String code, String status);

    /***
     * 根据收货单回写Wms调拨单明细
     * @param receive
     */
    void updateWmsAllocationInfo(Receive receive);

    /**
     * 审核数据列表
     * @param dto
     * @return
     */
    List<AllocationVO> auditList(AllocationDTO dto);

    AllocationVO auditListSum(AllocationDTO dto);
}
